<template>
  <div>
    <el-table ref="table" :data="unique" style="min-width: 100%" size="small" row-key="id" class="table">
      <el-table-column label="图片" min-width="70">
        <template slot-scope="scope">
          <div>
            <el-image v-viewer :src="scope.row.bom_imgurls?scope.row.bom_imgurls[0]:''">
              <div slot="error" class="image-slot" />
            </el-image>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="原料类别/单位" min-width="100">
        <template slot-scope="scope">
          {{ scope.row.sort_name }} / {{ scope.row.use_unit }}
        </template>
      </el-table-column>
      <el-table-column label="原料简称" min-width="120" prop="bom_name" />
      <el-table-column label="原料编码" min-width="180" prop="bom_sku_id" />
      <el-table-column label="颜色" min-width="80" prop="color_name" />
      <el-table-column label="规格" min-width="70" prop="spec_two_code" />
      <el-table-column label="单件成本" min-width="75" prop="price" />
      <el-table-column label="损耗(%)" min-width="70" prop="wastage" />
      <el-table-column label="采购需求总数" min-width="100" />
      <el-table-column label="额外建议采购数" min-width="110" prop="suggest_purchase" />
      <el-table-column label="计划采购数" min-width="80" prop="consume_30day" />
      <el-table-column label="采购周期(天)" min-width="90" prop="period" />
      <el-table-column label="可用库存数" min-width="80" prop="stock_actual" />
      <el-table-column label="采购在途数(预计到货时间)" min-width="160">
        <template slot-scope="scope">
          {{ scope.row.stock_reserve }} / {{ scope.row.receive_time }}
        </template>
      </el-table-column>
      <el-table-column label="已锁定库存" min-width="80" prop="goods_bom_lock" />
      <el-table-column label="总库存数" min-width="70" prop="stock" />
      <el-table-column label="原料预警下限" min-width="100" prop="stock_safe_down" />
    </el-table>
  </div>
</template>
<script>
export default {
  name: 'Detailed',
  props: {
    unique: {
      type: Array,
      default: () => {
        return []
      }
    }
  }
}
</script>
